package site.jlopen.assets.shiro.match;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.SimpleCredentialsMatcher;
import org.springframework.stereotype.Component;

import site.jlopen.assets.shiro.token.JwtToken;
 
 
@Component
public class MyCredentialsMatcher extends SimpleCredentialsMatcher {
 
    @Override
    public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
    	// 如果免密登录则直接返回true
		if(token instanceof JwtToken) {
			return true;
		}
		return false;
 
    }
}